const ENV = process.env.NODE_ENV;
const { VantResolver } = require('unplugin-vue-components/resolvers');
const ComponentsPlugin = require('unplugin-vue-components/webpack');

module.exports = {
    lintOnSave: ENV !== 'production',
    publicPath: './',
    productionSourceMap: false,
    devServer: {
        proxy: {
            '/api': {
              // 目标路径
                target: 'http://43.139.40.148:7000',
                // 允许跨域
                changeOrigin: true,
                // 重写路径
                pathRewrite: {
                    '^/api': ''
                }
            }
        }
    },
    configureWebpack: {
      plugins: [
        ComponentsPlugin({
          resolvers: [VantResolver()],
        }),
      ],
    },
};